#delimit ;
set more off;

/*NOTE: For a Mac, file path names use a forward slash (/) but for 
PC's they require a backward slash (\). Make these changes below 
if necessary depending on your computer type. 
*/

*Dropbox paths by user;
if c(username)=="shayaksarkar" {;
	local path "/Users/shayaksarkar/Desktop/ReStat_Data_Publication";
};

/*TABLE A6*/;

cd `path';

use "`path'/dta/final_sophistication.dta", clear;

local se cluster(date_auditor);

local controls govt_under agent_home auditor_home auditor_office other_venue;

reg anyterm sophisticated, `se';
	estadd ysumm;
	eststo;

areg anyterm sophisticated `controls', absorb(ms_id) `se';
	estadd ysumm;
	eststo;

reg onlyterm sophisticated, `se';
	estadd ysumm;
	eststo;

areg onlyterm sophisticated `controls', absorb(ms_id) `se';
	estadd ysumm;
	eststo;

reg ln_trc sophisticated, `se';
	estadd ysumm;
	eststo;

areg ln_trc sophisticated `controls', absorb(ms_id) `se';
	estadd ysumm;
	eststo;

reg ln_tpr sophisticated, `se';
	estadd ysumm;
	eststo;

areg ln_tpr sophisticated `controls', absorb(ms_id) `se';
	estadd ysumm;
	eststo;

* Output to Excel file;
esttab est1 est2 est3 est4 est5 est6 est7 est8 using "`path'/out/tableA6.csv", replace 
cells("b(fmt(5)) _star" se(fmt(5) ))  starlevels(* .1 ** .05 *** .01)
stats (ymean N, fmt( 4 %12.0fc) label("Dep. Var. Mean" N )) plain;
eststo clear;
	
